﻿<UserControl x:Class="Chambills.PopupBehaviour.Sample.NonModalDialogSample"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:e="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:Dialogs="clr-namespace:Chambills.PopUpBehavior;assembly=Chambills.PopUpBehavior" xmlns:Sample="clr-namespace:Chambills.PopupBehaviour.Sample" mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">
  <Grid>
    <Grid.RowDefinitions>
      <RowDefinition Height="20"/>
      <RowDefinition />
    </Grid.RowDefinitions>
    
    <CheckBox Grid.Row="0" x:Name="Go" Content="Show/Hide Dialog" />
    
    <Grid Grid.Row="1">
      
      <e:Interaction.Behaviors>
        <Dialogs:PopUpBehaviour Modal="false"  Visible="{Binding ElementName=Go, Path=IsChecked, Mode=TwoWay}">
          <Dialogs:PopUpBehaviour.PopUp>
            <Sample:Dialog />
          </Dialogs:PopUpBehaviour.PopUp>
        </Dialogs:PopUpBehaviour>
      </e:Interaction.Behaviors>
      
      <Grid.RowDefinitions>
        <RowDefinition />
        <RowDefinition />
        <RowDefinition />
      </Grid.RowDefinitions>
      <Grid.ColumnDefinitions>
        <ColumnDefinition />
        <ColumnDefinition />
      </Grid.ColumnDefinitions>

      <TextBox Grid.Row="0" Grid.Column="0" Text="[0,0]" Width="50"/>
      <TextBox Grid.Row="0" Grid.Column="1" Text="[0,1]" Width="50"/>
      <TextBox Grid.Row="1" Grid.Column="0" Text="[1,0]" Width="50"/>
      <TextBox Grid.Row="1" Grid.Column="1" Text="[1,1]" Width="50"/>
      <TextBlock Grid.Row="2" Grid.ColumnSpan="2" Text="The background controls are still accessible whilst this dialog is visible"/>


    </Grid>

  </Grid>
</UserControl>
